package org.ehe.finance.receipt.domain.bo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.Digits;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @author :zhangnn
 * @className :ReceiptDetailBo
 * @description: TODO
 * @date 2025-09-02 15:23:02
 */
@Data
public class ReceiptDetailBo {
    /**
     * 收款明细ID
     */
    @Schema(description = "收款明细ID")
    private Long id;

    /**
     * 应收账款ID
     */
    @Schema(description = "应收账款ID")
    private Long receivableId;

    /**
     * 核销金额
     */
    @Schema(description = "核销金额")
    @NotNull(message = "核销金额不能为空")
    @DecimalMin(value = "0.01", message = "核销金额必须大于0")
    @Digits(integer = 16, fraction = 2, message = "核销金额格式不正确")
    private BigDecimal settleAmount;

    /**
     * 优惠金额
     */
    @Schema(description = "优惠金额")
    @DecimalMin(value = "0", message = "优惠金额不能小于0")
    @Digits(integer = 16, fraction = 2, message = "优惠金额格式不正确")
    private BigDecimal discountAmount = BigDecimal.ZERO;

    /**
     * 备注
     */
    @Schema(description = "备注")
    @Size(max = 255, message = "备注长度不能超过{max}个字符")
    private String remark;
}
